#pragma once

#include "common.h"

#include "TSingleton.h"
#include "IInitalizable.h"

#include "Sys.h"


//File information structure
struct FileInfo
{
	LocalTime creationTime;
	LocalTime lastAccessTime;
	LocalTime lastWriteTime;
	u32 fileSize;
};

//File system class
//Provides methods to operate on files and directories
class FileSystem : public TSingleton<FileSystem>, public IInitalizable
{
	friend TSingleton<FileSystem>;
public:
	void Init();
	void Shutdown();
	bool IsInitialized();

	//File functions
	bool MoveFile(const char* src, const char* dst);
	bool CopyFile(const char* pathSrc, const char* pathDst);
	bool DelFile(const char* filename);
	FileInfo GetFileInfo(File file) const;
	

	//Directory functions
	bool CreateDir(const char* path);	
	bool DeleteDir(const char* path);

protected:
	FileSystem(void) {initialized = false;};
	FileSystem(const FileSystem& s) {};
	~FileSystem(void) {};

private:
	bool initialized;
};